package com.auto.sns.core.dao.impl;

import java.util.List;
import java.util.Map;

import com.system.common.Page;
import com.auto.sns.core.domain.SnsCoreHyperlink;
import com.auto.sns.core.dao.ISnsCoreHyperlinkDAO;
import com.system.util.PersistUtil;
import com.auto.sns.core.sql.sqlid.SnsCoreActivitySqlID;
import com.auto.sns.core.sql.sqlid.SnsCoreHyperlinkSqlID;
/**
 * : t_auto_sns_core_hyperlink
 * 
 * 
 * @author Gen
 */
public class SnsCoreHyperlinkDAOImpl implements ISnsCoreHyperlinkDAO{

	public SnsCoreHyperlink insertSnsCoreHyperlink(SnsCoreHyperlink bean){
		return PersistUtil.insert(bean, SnsCoreHyperlinkSqlID.INSERT);
	}

	public boolean deleteSnsCoreHyperlink(String schyGuid){
		PersistUtil.delete(schyGuid, SnsCoreHyperlinkSqlID.DELETE);
		return true;
	}	

	public SnsCoreHyperlink updateSnsCoreHyperlink(SnsCoreHyperlink bean){
		return PersistUtil.update(bean, SnsCoreHyperlinkSqlID.UPDATE);
	}	

	public SnsCoreHyperlink loadSnsCoreHyperlink(String schyGuid){
		return PersistUtil.query(new SnsCoreHyperlink().getClass(), schyGuid);
	}

	public List<SnsCoreHyperlink> queryList(Map<String,Object> param,Page page){
		page.setCount(PersistUtil.countSpecial(param, SnsCoreHyperlinkSqlID.QUERY));
		return PersistUtil.querySpecial(param, SnsCoreHyperlinkSqlID.QUERY, page.getFullOrderBy(), page.getOffset(), page.getLimit());
	}

	public boolean updateReplyNum(String schyGuid) {
		PersistUtil.update(schyGuid, SnsCoreActivitySqlID.UPDATE_REPLY_NUM);
		return true;
	}

	public boolean updateRecommendNum(String schyGuid) {
		PersistUtil.update(schyGuid, SnsCoreActivitySqlID.UPDATE_RECOMMEND_NUM);
		return true;
	}

	public boolean updateFavoriteNum(String schyGuid) {
		PersistUtil.update(schyGuid, SnsCoreActivitySqlID.UPDATE_FAVORITE_NUM);
		return true;
	}

}
